Environmental change represents a major threat to species persistence. When change is rapid, a population's only means of persisting may be to evolve resistance. Understanding such ‘evolutionary rescues’ is important for conservation in the face of global change, but also in the agricultural and medical sciences, where the objective is rather population control or eradication. Theory predicts that evolutionary rescue is fostered by large populations and genetic variation, but this has yet to be tested. We replicated hundreds of populations of the bacterium Pseudomonas fluorescens SBW25 submitted to a range of doses of the antibiotic streptomycin. Consistent with theory, population size, and initial genetic diversity influenced population persistence and the evolution of antibiotic resistance. Although all treated populations suffered initial declines, those experiencing the smallest decreases were most likely to be evolutionarily rescued. Our results contribute to our understanding of how evolution may or may not save populations and species from extinction.